import sys
from passlib.apps import custom_app_context as pwd_context

#print "\n".join(sys.argv[1:])

if(__name__=="__main__"):
    if(len(sys.argv) <3):
        print "Usage:\n python generate_password_file.py [username] [password]"
    else:
        username = sys.argv[1]
        password = sys.argv[2]
        # generate new salt, and hash a password
        hash = pwd_context.encrypt(password, category="admin")
        open(".albumpasswd", "wb").write("%s:%s"%(username, hash))



